<html lang="en" class=" no-js" xmlns:fb="http://ogp.me/ns/fb#"><!--<![endif]--><head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

	<title>Lets say A is a friend of B an | CareerCup </title>
	<meta name="description" content="">
	<meta name="author" content="">
	<script type="text/javascript" async="" src="//s.swiftypecdn.com/cc.js"></script><script type="text/javascript" async="" src="//s.swiftypecdn.com/assets/swiftype_nocode-3bfc89795ad2716e6884d69afe9c64c669b7526122423de82e3142f1578e5553.js"></script><script src="https://connect.facebook.net/en_US/all.js?hash=e786bd41f6df3193b0d63458024bf2cb" async="" crossorigin="anonymous"></script><script type="text/javascript" async="" src="https://ssl.google-analytics.com/ga.js"></script><script type="text/javascript" async="" src="//swiftype.com/embed.js"></script><script id="facebook-jssdk" src="//connect.facebook.net/en_US/all.js#xfbml=1&amp;appId=159992514098768"></script><script src="/js/ccscript.js" type="text/javascript"></script>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link title="RSS" href="http://feeds.feedburner.com/Careercup" type="application/rss+xml" rel="alternate">

	<link rel="shortcut icon" href="/favicon.ico">
	<link rel="stylesheet" href="/stylesheets/style.css?v=2">
	<link rel="stylesheet" href="/stylesheets/tinydropdown.css" type="text/css">
	<script type="text/javascript" src="https://www.google.com/jsapi"></script>
	<script type="text/javascript" src="/scripts/jquery-1.3.2.js"></script>
	<script type="text/javascript">google.load('jquery', '1.7.1');</script><script type="text/javascript" charset="UTF-8" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

	<link rel="stylesheet" type="text/css" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css">
	<script type="text/javascript" src="/js/jquery.regValidator.js"></script>
	<script type="text/javascript" src="/js/regex.js"></script>
	<script type="text/javascript" src="/js/jquery.cookie.js"></script>
	<script type="text/javascript" src="/js/userinfo.js"></script>
	<script src="/js/jquery.timeago.js" type="text/javascript"></script>

	<script type="text/javascript" src="/scripts/tinydropdown.js"></script>

	<link href="/stylesheets/prism.css" rel="stylesheet">


<meta property="st:type" content="question">
<meta property="st:image" content="http://www.careercup.com/attributeimages/hi5-interview-questions.png">
<meta property="og:site_name" content="CareerCup.com">
<meta property="og:image" content="http://www.careercup.com/images/facebook_share_image.jpg">
<meta property="og:title" content="Hi5 Interview Question  for Software Engineer / Developers">
<meta property="og:description" content="Lets say A is a friend of B and B is a friend of C then A and C are two degree friends. So we have to implement a function that takes two friends and return true if they are 2 degree friends. How will you implement this function efficiently.">


<meta property="st:info" content="company_names:Hi5">
<meta property="st:info" content="company_ids:hi5-interview-questions">



<meta property="st:info" content="job_names:Software Engineer / Developer">
<meta property="st:info" content="job_ids:software-engineer-developer-interview-questions">



<meta property="st:info" content="topic_names:Algorithm">
<meta property="st:info" content="topic_ids:algorithm-interview-questions">



<meta property="st:info" content="author_id:56435">
<meta property="st:info" content="author_name:gauravk.18">









	<!--[if lt IE 9]>
	<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
<link rel="stylesheet" type="text/css" href="//s.swiftypecdn.com/assets/swiftype_nocode-911ccbd6a1f2b9ef077181640fe490b88343c5fa4480cc8186ec035fff37811d.css"><style type="text/css" data-fbcssmodules="css:fb.css.base css:fb.css.dialog css:fb.css.iframewidget css:fb.css.customer_chat_plugin_iframe">.fb_hidden{position:absolute;top:-10000px;z-index:10001}.fb_reposition{overflow:hidden;position:relative}.fb_invisible{display:none}.fb_reset{background:none;border:0;border-spacing:0;color:#000;cursor:auto;direction:ltr;font-family:'lucida grande', tahoma, verdana, arial, sans-serif;font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:1;margin:0;overflow:visible;padding:0;text-align:left;text-decoration:none;text-indent:0;text-shadow:none;text-transform:none;visibility:visible;white-space:normal;word-spacing:normal}.fb_reset>div{overflow:hidden}@keyframes fb_transform{from{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.fb_animate{animation:fb_transform .3s forwards}
.fb_hidden{position:absolute;top:-10000px;z-index:10001}.fb_reposition{overflow:hidden;position:relative}.fb_invisible{display:none}.fb_reset{background:none;border:0;border-spacing:0;color:#000;cursor:auto;direction:ltr;font-family:'lucida grande', tahoma, verdana, arial, sans-serif;font-size:11px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:1;margin:0;overflow:visible;padding:0;text-align:left;text-decoration:none;text-indent:0;text-shadow:none;text-transform:none;visibility:visible;white-space:normal;word-spacing:normal}.fb_reset>div{overflow:hidden}@keyframes fb_transform{from{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.fb_animate{animation:fb_transform .3s forwards}
.fb_dialog{background:rgba(82, 82, 82, .7);position:absolute;top:-10000px;z-index:10001}.fb_dialog_advanced{border-radius:8px;padding:10px}.fb_dialog_content{background:#fff;color:#373737}.fb_dialog_close_icon{background:url(https://z-p3-static.xx.fbcdn.net/rsrc.php/v3/yq/r/IE9JII6Z1Ys.png) no-repeat scroll 0 0 transparent;cursor:pointer;display:block;height:15px;position:absolute;right:18px;top:17px;width:15px}.fb_dialog_mobile .fb_dialog_close_icon{left:5px;right:auto;top:5px}.fb_dialog_padding{background-color:transparent;position:absolute;width:1px;z-index:-1}.fb_dialog_close_icon:hover{background:url(https://z-p3-static.xx.fbcdn.net/rsrc.php/v3/yq/r/IE9JII6Z1Ys.png) no-repeat scroll 0 -15px transparent}.fb_dialog_close_icon:active{background:url(https://z-p3-static.xx.fbcdn.net/rsrc.php/v3/yq/r/IE9JII6Z1Ys.png) no-repeat scroll 0 -30px transparent}.fb_dialog_iframe{line-height:0}.fb_dialog_content .dialog_title{background:#6d84b4;border:1px solid #365899;color:#fff;font-size:14px;font-weight:bold;margin:0}.fb_dialog_content .dialog_title>span{background:url(https://z-p3-static.xx.fbcdn.net/rsrc.php/v3/yd/r/Cou7n-nqK52.gif) no-repeat 5px 50%;float:left;padding:5px 0 7px 26px}body.fb_hidden{height:100%;left:0;margin:0;overflow:visible;position:absolute;top:-10000px;transform:none;width:100%}.fb_dialog.fb_dialog_mobile.loading{background:url(https://z-p3-static.xx.fbcdn.net/rsrc.php/v3/ya/r/3rhSv5V8j3o.gif) white no-repeat 50% 50%;min-height:100%;min-width:100%;overflow:hidden;position:absolute;top:0;z-index:10001}.fb_dialog.fb_dialog_mobile.loading.centered{background:none;height:auto;min-height:initial;min-width:initial;width:auto}.fb_dialog.fb_dialog_mobile.loading.centered #fb_dialog_loader_spinner{width:100%}.fb_dialog.fb_dialog_mobile.loading.centered .fb_dialog_content{background:none}.loading.centered #fb_dialog_loader_close{clear:both;color:#fff;display:block;font-size:18px;padding-top:20px}#fb-root #fb_dialog_ipad_overlay{background:rgba(0, 0, 0, .4);bottom:0;left:0;min-height:100%;position:absolute;right:0;top:0;width:100%;z-index:10000}#fb-root #fb_dialog_ipad_overlay.hidden{display:none}.fb_dialog.fb_dialog_mobile.loading iframe{visibility:hidden}.fb_dialog_mobile .fb_dialog_iframe{position:sticky;top:0}.fb_dialog_content .dialog_header{background:linear-gradient(from(#738aba), to(#2c4987));border-bottom:1px solid;border-color:#043b87;box-shadow:white 0 1px 1px -1px inset;color:#fff;font:bold 14px Helvetica, sans-serif;text-overflow:ellipsis;text-shadow:rgba(0, 30, 84, .296875) 0 -1px 0;vertical-align:middle;white-space:nowrap}.fb_dialog_content .dialog_header table{height:43px;width:100%}.fb_dialog_content .dialog_header td.header_left{font-size:12px;padding-left:5px;vertical-align:middle;width:60px}.fb_dialog_content .dialog_header td.header_right{font-size:12px;padding-right:5px;vertical-align:middle;width:60px}.fb_dialog_content .touchable_button{background:linear-gradient(from(#4267B2), to(#2a4887));background-clip:padding-box;border:1px solid #29487d;border-radius:3px;display:inline-block;line-height:18px;margin-top:3px;max-width:85px;padding:4px 12px;position:relative}.fb_dialog_content .dialog_header .touchable_button input{background:none;border:none;color:#fff;font:bold 12px Helvetica, sans-serif;margin:2px -12px;padding:2px 6px 3px 6px;text-shadow:rgba(0, 30, 84, .296875) 0 -1px 0}.fb_dialog_content .dialog_header .header_center{color:#fff;font-size:16px;font-weight:bold;line-height:18px;text-align:center;vertical-align:middle}.fb_dialog_content .dialog_content{background:url(https://z-p3-static.xx.fbcdn.net/rsrc.php/v3/y9/r/jKEcVPZFk-2.gif) no-repeat 50% 50%;border:1px solid #4a4a4a;border-bottom:0;border-top:0;height:150px}.fb_dialog_content .dialog_footer{background:#f5f6f7;border:1px solid #4a4a4a;border-top-color:#ccc;height:40px}#fb_dialog_loader_close{float:left}.fb_dialog.fb_dialog_mobile .fb_dialog_close_icon{visibility:hidden}#fb_dialog_loader_spinner{animation:rotateSpinner 1.2s linear infinite;background-color:transparent;background-image:url(https://z-p3-static.xx.fbcdn.net/rsrc.php/v3/yD/r/t-wz8gw1xG1.png);background-position:50% 50%;background-repeat:no-repeat;height:24px;width:24px}@keyframes rotateSpinner{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}
.fb_iframe_widget{display:inline-block;position:relative}.fb_iframe_widget span{display:inline-block;position:relative;text-align:justify}.fb_iframe_widget iframe{position:absolute}.fb_iframe_widget_fluid_desktop,.fb_iframe_widget_fluid_desktop span,.fb_iframe_widget_fluid_desktop iframe{max-width:100%}.fb_iframe_widget_fluid_desktop iframe{min-width:220px;position:relative}.fb_iframe_widget_lift{z-index:1}.fb_iframe_widget_fluid{display:inline}.fb_iframe_widget_fluid span{width:100%}
.fb_mpn_mobile_landing_page_slide_out{animation-duration:200ms;animation-name:fb_mpn_landing_page_slide_out;transition-timing-function:ease-in}.fb_mpn_mobile_landing_page_slide_out_from_left{animation-duration:200ms;animation-name:fb_mpn_landing_page_slide_out_from_left;transition-timing-function:ease-in}.fb_mpn_mobile_landing_page_slide_up{animation-duration:500ms;animation-name:fb_mpn_landing_page_slide_up;transition-timing-function:ease-in}.fb_mpn_mobile_bounce_in{animation-duration:300ms;animation-name:fb_mpn_bounce_in;transition-timing-function:ease-in}.fb_mpn_mobile_bounce_out{animation-duration:300ms;animation-name:fb_mpn_bounce_out;transition-timing-function:ease-in}.fb_mpn_mobile_bounce_out_v2{animation-duration:300ms;animation-name:fb_mpn_fade_out;transition-timing-function:ease-in}.fb_customer_chat_bounce_in_v2{animation-duration:300ms;animation-name:fb_bounce_in_v2;transition-timing-function:ease-in}.fb_customer_chat_bounce_in_from_left{animation-duration:300ms;animation-name:fb_bounce_in_from_left;transition-timing-function:ease-in}.fb_customer_chat_bounce_out_v2{animation-duration:300ms;animation-name:fb_bounce_out_v2;transition-timing-function:ease-in}.fb_customer_chat_bounce_out_from_left{animation-duration:300ms;animation-name:fb_bounce_out_from_left;transition-timing-function:ease-in}.fb_invisible_flow{display:inherit;height:0;overflow-x:hidden;width:0}@keyframes fb_mpn_landing_page_slide_out{0%{margin:0 12px;width:100% - 24px}60%{border-radius:18px}100%{border-radius:50%;margin:0 24px;width:60px}}@keyframes fb_mpn_landing_page_slide_out_from_left{0%{left:12px;width:100% - 24px}60%{border-radius:18px}100%{border-radius:50%;left:12px;width:60px}}@keyframes fb_mpn_landing_page_slide_up{0%{bottom:0;opacity:0}100%{bottom:24px;opacity:1}}@keyframes fb_mpn_bounce_in{0%{opacity:.5;top:100%}100%{opacity:1;top:0}}@keyframes fb_mpn_fade_out{0%{bottom:30px;opacity:1}100%{bottom:0;opacity:0}}@keyframes fb_mpn_bounce_out{0%{opacity:1;top:0}100%{opacity:.5;top:100%}}@keyframes fb_bounce_in_v2{0%{opacity:0;transform:scale(0, 0);transform-origin:bottom right}50%{transform:scale(1.03, 1.03);transform-origin:bottom right}100%{opacity:1;transform:scale(1, 1);transform-origin:bottom right}}@keyframes fb_bounce_in_from_left{0%{opacity:0;transform:scale(0, 0);transform-origin:bottom left}50%{transform:scale(1.03, 1.03);transform-origin:bottom left}100%{opacity:1;transform:scale(1, 1);transform-origin:bottom left}}@keyframes fb_bounce_out_v2{0%{opacity:1;transform:scale(1, 1);transform-origin:bottom right}100%{opacity:0;transform:scale(0, 0);transform-origin:bottom right}}@keyframes fb_bounce_out_from_left{0%{opacity:1;transform:scale(1, 1);transform-origin:bottom left}100%{opacity:0;transform:scale(0, 0);transform-origin:bottom left}}@keyframes slideInFromBottom{0%{opacity:.1;transform:translateY(100%)}100%{opacity:1;transform:translateY(0)}}@keyframes slideInFromBottomDelay{0%{opacity:0;transform:translateY(100%)}97%{opacity:0;transform:translateY(100%)}100%{opacity:1;transform:translateY(0)}}</style></head>

<body>

<div id="fb-root" class=" fb_reset"><div style="position: absolute; top: -10000px; width: 0px; height: 0px;"><div></div></div></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=159992514098768";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
	<script>var country_origin = "CN"; var _user_id = null; var _url = "https://careercup.com/_ah/conflogin?continue=https://careercup.com/question%3Fid%3D2780"; </script>

	<header id="page_head">
		<div class="row">
			<div class="column grid_6" style="width: 260px;">
				<h1 id="logo"><a href="/">CareerCup</a></h1>

			</div>
			<div class="column grid_6" style="width: 660px;">
				<ul class="page_nav" id="page_nav">
					<li><a href="/page" class="page_navlink">Questions</a></li>
					<li><a href="/forum" class="page_navlink">Forum</a></li>
					<li><a href="/resume" class="page_navlink">Resume Tips</a></li>
					<li><a href="http://feeds.feedburner.com/Careercup" class="page_navlink">RSS</a></li>

					<li><a href="https://careercup.com/_ah/conflogin?continue=https://careercup.com/question%3Fid%3D2780">Sign In</a></li>

				<form>
  <input type="text" id="st-search-input" class="st-search-input" style="float: right; top: -20px; position: relative; outline: none;" autocomplete="off" autocorrect="off" autocapitalize="off">
</form>
<div id="st-results-container"></div>
<script type="text/javascript">
  var Swiftype = window.Swiftype || {};
  (function() {
    Swiftype.key = 'snLwd21iaMqEyojgVKLs';
    Swiftype.inputElement = '#st-search-input';
    Swiftype.resultContainingElement = '#st-results-container';
    Swiftype.attachElement = '#st-search-input';
    Swiftype.renderStyle = "overlay";

    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.async = true;
    script.src = "//swiftype.com/embed.js";
    var entry = document.getElementsByTagName('script')[0];
    entry.parentNode.insertBefore(script, entry);
  }());
</script>
			</ul></div>
		</div>

	</header><!-- end page header -->

	<div id="main">

		<div class="row">
			<div class="column grid_9" id="mainpagebody">


<h2>
				Hi5

			Interview Question

				<span class="widgetRightArrow">
					for
				</span>


		        Software Engineer / Developers

	    			</h2>
<ul id="question_preview">
		<li class="question"><div class="authorContent56435"><div class="companyAndVote">
	<span class="company"><img src="/attributeimages/hi5-interview-questions.png" title="Hi5" alt="hi5-interview-questions"></span>
	<div class="votesWrapper votesWrapperQuestion" id="votes2780">
		<div class="arrowUpQuestion authorHide56435" onclick="javascript:vote(1, 2780, 'question')" id="arrowUp2780"></div>
		<div class="arrowUpQuestionDisabled authorShow56435" style="display: none;"></div>
		<div class="votesNetQuestion" id="votesNet2780">0</div>
		<div class="arrowDownQuestion authorHide56435" onclick="javascript:vote(-1, 2780, 'question')" id="arrowDown2780"></div>
		<div class="arrowDownQuestionDisabled authorShow56435" style="display: none;"></div>
		<div class="votesCountQuestion" id="votesCount2780">of <span id="votesCountActual2780">0</span> votes</div>
		<div class="clearance"></div>
	</div>
</div>
	<span class="ratingAndFav">
		<span id="question2780favorite" class="favorite favoriteQuestion favoriteOff" onclick="javascript:addFavorite(2780, 'question')" alt="Follow" title="Follow"></span>
		<span class="rating"><a href="/question?id=2780"><span class="commentCount">11</span> <br>Answers</a></span>
	</span>
	<span class="entry">

		<a href="/question?id=2780"><p>Lets say A is a friend of B and B is a friend of C then A and C are two degree friends. So we have to implement a function that takes two friends and return true if they are 2 degree friends. How will you implement this function efficiently.</p></a>
		<span class="author">
			- <a href="/user?id=56435" onmouseover="popup(56435);">gauravk.18</a> <abbr class="timeago" title="2008-05-04T16:08:38Z">May 04, 2008</abbr>
			<edit author_id="56435" href="/add?id=2780"></edit> | <a href="/reportduplicate?id=2780">Report Duplicate</a> | <a href="/flagquestion?id=2780">Flag</a> | <a onclick="javascript:purgeUserContent(56435)" class="adminShow purgeUserLink56435 clickable" style="display: none;">PURGE</a> </span>
		<br>
	</span>
	<span class="tags">

		<a href="/page?pid=hi5-interview-questions">Hi5</a>

		<a href="/page?pid=software-engineer-developer-interview-questions">Software Engineer / Developer</a>

		<a href="/page?pid=algorithm-interview-questions">Algorithm</a>

	</span>
	<div class="clearance"></div></div></li>
</ul>
<br>
<div class="social_share_buttons">

	<div class="social_share_button subscribe_button">
	<div class="is_subscribed_items" style="display: none;">
		<div class="subscribe_image subscribe_image_subscribed">&nbsp;</div>
		<div class="subscribe_text">Email me when people comment.</div>
	</div>
	<div class="is_unsubscribed_items">
		<div class="subscribe_image subscribe_image_unsubscribed">&nbsp;</div>
		<div class="subscribe_text">Email me when people comment.</div>
	</div>
	<div class="subscribe_loading_items">
		<div class="subscribe_image subscribe_image_loading">&nbsp;</div>
		<div class="subscribe_text">Loading...</div>
	</div>
	<div class="subscribe_loading_error">
		<div class="subscribe_image subscribe_image_error">&nbsp;</div>
		<div class="subscribe_text">An error occurred in subscribing you.</div>
	</div>
	<div class="clearance"></div>
</div>


	<div class="social_share_button">
		<fb:like href="http://www.careercup.com/question?id=2780" send="false" layout="button_count" show_faces="false" class=" fb_iframe_widget" fb-xfbml-state="rendered" fb-iframe-plugin-query="app_id=159992514098768&amp;container_width=0&amp;href=http%3A%2F%2Fwww.careercup.com%2Fquestion%3Fid%3D2780&amp;layout=button_count&amp;locale=en_US&amp;sdk=joey&amp;send=false&amp;show_faces=false"><span style="vertical-align: bottom; width: 90px; height: 28px;"><iframe name="fa95a0ede7df62a37" width="1000px" height="1000px" data-testid="fb:like Facebook Social Plugin" title="fb:like Facebook Social Plugin" frameborder="0" allowtransparency="true" allowfullscreen="true" scrolling="no" allow="encrypted-media" src="https://web.facebook.com/plugins/like.php?app_id=159992514098768&amp;channel=https%3A%2F%2Fstaticxx.facebook.com%2Fx%2Fconnect%2Fxd_arbiter%2F%3Fversion%3D46%23cb%3Df49634c9237f4c6c8%26domain%3Dcareercup.com%26is_canvas%3Dfalse%26origin%3Dhttps%253A%252F%252Fcareercup.com%252Ff893b5ab90aaf9886%26relation%3Dparent.parent&amp;container_width=0&amp;href=http%3A%2F%2Fwww.careercup.com%2Fquestion%3Fid%3D2780&amp;layout=button_count&amp;locale=en_US&amp;sdk=joey&amp;send=false&amp;show_faces=false" style="border: none; visibility: visible; width: 90px; height: 28px;" class=""></iframe></span></fb:like>
	</div>
	<div class="clearance"></div>
</div>
	<span class="additional_data">




	</span>
<br><br>
<div id="commentThread2780">
<div>
</div>
</div>
<div class="social_share_buttons">
<div class="social_share_button subscribe_button">
	<div class="is_subscribed_items" style="display: none;">
		<div class="subscribe_image subscribe_image_subscribed">&nbsp;</div>
		<div class="subscribe_text">Email me when people comment.</div>
	</div>
	<div class="is_unsubscribed_items">
		<div class="subscribe_image subscribe_image_unsubscribed">&nbsp;</div>
		<div class="subscribe_text">Email me when people comment.</div>
	</div>
	<div class="subscribe_loading_items">
		<div class="subscribe_image subscribe_image_loading">&nbsp;</div>
		<div class="subscribe_text">Loading...</div>
	</div>
	<div class="subscribe_loading_error">
		<div class="subscribe_image subscribe_image_error">&nbsp;</div>
		<div class="subscribe_text">An error occurred in subscribing you.</div>
	</div>
	<div class="clearance"></div>
</div>

</div>
<br><br>
<div id="commentThread2780">
<div>
	</div><div id="commentThread3468">
    <div class="collapsedComment " id="collapsedComment3468" onclick="javascript:uncollapseComment(3468);">Comment hidden because of low score. Click to expand.</div>
<div class="uncollapsedComment" id="uncollapsedComment3468">
<a name="comment3468"></a>

<div class="comment">

	<div class="votesWrapper" id="votes3468">

		<div class="arrowUp authorHide0" onclick="javascript:vote(1, 3468, 'comment')" id="arrowUp3468"></div>
		<div class="arrowUpDisabled authorShow0" style="display: none;"></div>
		<div class="votesNet" id="votesNet3468">0</div>
		<div class="arrowDown  authorHide0" onclick="javascript:vote(-1, 3468, 'comment')" id="arrowDown3468"></div>
		<div class="arrowDownDisabled authorShow0" style="display: none;" id="arrowDown3468"></div>
		<div class="votesCount" id="votesCount3468">of <span id="votesCountActual3468">0</span> vote</div>
		<div class="clearance"></div>

	</div>
	<div class="commentMain">
		<div class="commentBody">

			<p>1. Assuming every person has id, sort friends of A and B O(NlogN)<br>2. Make sure A and B are not first degree friends. Binary search B in A's friends or vice versa. Return false if found.<br>3. For every friend in A, do binary search on B's friends O(NlogN). Return true if found, false otherwise.</p>
		<span class="author">

			-
					Anonymous
				 <abbr class="timeago" title="2008-05-15T02:37:53Z">May 15, 2008</abbr> <span><edit author_id="0" href="/editcomment?id=3468"></edit> | <a href="/flagcomment?id=3468">Flag</a>


			<a onclick="javascript:insertReply('unknown', 3468, 2780);" class="replyButton" id="replyButton3468">Reply</a>
			<div class="clearance"></div>

		</span>
		</span></div>
	</div>
	<div class="clearance"></div>
</div>

<div class="clearance"></div>
</div>


    <div class="collapsedComment collapsedCommentChild" id="collapsedComment3467" onclick="javascript:uncollapseComment(3467);">Comment hidden because of low score. Click to expand.</div>
<div class="uncollapsedComment" id="uncollapsedComment3467">
<a name="comment3467"></a>

<div class="childComment">

	<div class="votesWrapper" id="votes3467">

	</div>
	<div class="commentMain">
		<div class="commentBody">

				<div class="votesWrapperSubComment votesWrapperQuestion" id="votes3467">
					<div class="arrowUpQuestion authorHide56435" onclick="javascript:vote(1, 3467, 'comment')" id="arrowUp3467"></div>
					<div class="arrowUpQuestionDisabled authorShow56435" style="display: none;"></div>
					<div class="votesNetQuestion" id="votesNet3467">0</div>
					<div class="arrowDownQuestion authorHide56435" onclick="javascript:vote(-1, 3467, 'comment')" id="arrowDown3467"></div>
					<div class="arrowDownQuestionDisabled authorShow56435" style="display: none;"></div>
					<div class="votesCountQuestion" id="votesCount3467">of <span id="votesCountActual3467">0</span> votes</div>
					<div class="clearance"></div>
				</div>

			<p>One of the solution is to run BFS but it won't be very efficient. One of the good way to solve this is to look the problem this way. Make a list of friends of A and make another list of friends of C. A and C are 2 degree friends if the two list we have made have at least one friend in common. This intersection can be efficiently done using O(n) time and memory complexity using a hash table.</p>
		<span class="author">

			-
					<a href="/user?id=56435" onmouseover="popup(56435);">gauravk.18</a>
				 <abbr class="timeago" title="2008-05-17T20:40:51Z">May 17, 2008</abbr> <span><edit author_id="56435" href="/editcomment?id=3467"></edit> | <a href="/flagcomment?id=3467">Flag</a>


		</span>
		</span></div>
	</div>
	<div class="clearance"></div>
</div>


			<div id="insertReplyHere3468" style="margin-left: 70px; display: none;"></div>

<div class="clearance"></div>
</div>

	</div><div id="commentThread6164">
    <div class="collapsedComment " id="collapsedComment6164" onclick="javascript:uncollapseComment(6164);">Comment hidden because of low score. Click to expand.</div>
<div class="uncollapsedComment" id="uncollapsedComment6164">
<a name="comment6164"></a>

<div class="comment">

	<div class="votesWrapper" id="votes6164">

		<div class="arrowUp authorHide56435" onclick="javascript:vote(1, 6164, 'comment')" id="arrowUp6164"></div>
		<div class="arrowUpDisabled authorShow56435" style="display: none;"></div>
		<div class="votesNet" id="votesNet6164">0</div>
		<div class="arrowDown  authorHide56435" onclick="javascript:vote(-1, 6164, 'comment')" id="arrowDown6164"></div>
		<div class="arrowDownDisabled authorShow56435" style="display: none;" id="arrowDown6164"></div>
		<div class="votesCount" id="votesCount6164">of <span id="votesCountActual6164">0</span> vote</div>
		<div class="clearance"></div>

	</div>
	<div class="commentMain">
		<div class="commentBody">

			<p>One of the solution is to run BFS but it won't be very efficieint. One of the good way to solve this is to look the problem this way. Make a list of friends of A and make another list of friends of C. A and C are 2 degree friends if the two list we have made have at least one friend in common. This intersection can be efficiently done using O(n) time and memory complexity using a hash table.</p>
		<span class="author">

			-
					<a href="/user?id=56435" onmouseover="popup(56435);">gauravk.18</a>
				 <abbr class="timeago" title="2008-05-16T14:26:13Z">May 16, 2008</abbr> <span><edit author_id="56435" href="/editcomment?id=6164"></edit> | <a href="/flagcomment?id=6164">Flag</a>


			<a onclick="javascript:insertReply('question', 6164, 2780);" class="replyButton" id="replyButton6164">Reply</a>
			<div class="clearance"></div>

		</span>
		</span></div>
	</div>
	<div class="clearance"></div>
</div>


			<div id="insertReplyHere6164" style="margin-left: 70px; display: none;"></div>

<div class="clearance"></div>
</div>

	</div><div id="commentThread5734">
    <div class="collapsedComment " id="collapsedComment5734" onclick="javascript:uncollapseComment(5734);">Comment hidden because of low score. Click to expand.</div>
<div class="uncollapsedComment" id="uncollapsedComment5734">
<a name="comment5734"></a>

<div class="comment">

	<div class="votesWrapper" id="votes5734">

		<div class="arrowUp authorHide1201" onclick="javascript:vote(1, 5734, 'comment')" id="arrowUp5734"></div>
		<div class="arrowUpDisabled authorShow1201" style="display: none;"></div>
		<div class="votesNet" id="votesNet5734">0</div>
		<div class="arrowDown  authorHide1201" onclick="javascript:vote(-1, 5734, 'comment')" id="arrowDown5734"></div>
		<div class="arrowDownDisabled authorShow1201" style="display: none;" id="arrowDown5734"></div>
		<div class="votesCount" id="votesCount5734">of <span id="votesCountActual5734">0</span> vote</div>
		<div class="clearance"></div>

	</div>
	<div class="commentMain">
		<div class="commentBody">

			<p>this be done simply like this ... <br><br>bool friend_finder(friend *A, friend *C)<br>{<br>int found=0;<br>    for(int i=0;i&lt;a-&gt;total_friends;i++)<br>     {     <br>         if(a-&gt;(friends+i)-&gt;friend==C)<br>                {<br>                   found=1;<br>                   break;<br>                 }<br>     }<br>if(found==0)<br>return false;<br>else<br>return true;<br>}</p>
		<span class="author">

			-
					<a href="/user?id=1201" onmouseover="popup(1201);">usafzz</a>
				 <abbr class="timeago" title="2008-05-20T09:36:16Z">May 20, 2008</abbr> <span><edit author_id="1201" href="/editcomment?id=5734"></edit> | <a href="/flagcomment?id=5734">Flag</a>


			<a onclick="javascript:insertReply('question', 5734, 2780);" class="replyButton" id="replyButton5734">Reply</a>
			<div class="clearance"></div>

		</span>
		</span></div>
	</div>
	<div class="clearance"></div>
</div>


			<div id="insertReplyHere5734" style="margin-left: 70px; display: none;"></div>

<div class="clearance"></div>
</div>

	</div><div id="commentThread3411">
    <div class="collapsedComment " id="collapsedComment3411" onclick="javascript:uncollapseComment(3411);">Comment hidden because of low score. Click to expand.</div>
<div class="uncollapsedComment" id="uncollapsedComment3411">
<a name="comment3411"></a>

<div class="comment">

	<div class="votesWrapper" id="votes3411">

		<div class="arrowUp authorHide0" onclick="javascript:vote(1, 3411, 'comment')" id="arrowUp3411"></div>
		<div class="arrowUpDisabled authorShow0" style="display: none;"></div>
		<div class="votesNet" id="votesNet3411">0</div>
		<div class="arrowDown  authorHide0" onclick="javascript:vote(-1, 3411, 'comment')" id="arrowDown3411"></div>
		<div class="arrowDownDisabled authorShow0" style="display: none;" id="arrowDown3411"></div>
		<div class="votesCount" id="votesCount3411">of <span id="votesCountActual3411">0</span> vote</div>
		<div class="clearance"></div>

	</div>
	<div class="commentMain">
		<div class="commentBody">

			<p>Hi Gaurav,<br><br>Can u please tell me are these questions asked on a phone interview or onsite interview?</p>
		<span class="author">

			-
					Charlie
				 <abbr class="timeago" title="2008-05-31T01:12:00Z">May 31, 2008</abbr> <span><edit author_id="0" href="/editcomment?id=3411"></edit> | <a href="/flagcomment?id=3411">Flag</a>


			<a onclick="javascript:insertReply('question', 3411, 2780);" class="replyButton" id="replyButton3411">Reply</a>
			<div class="clearance"></div>

		</span>
		</span></div>
	</div>
	<div class="clearance"></div>
</div>

<div class="clearance"></div>
</div>


    <div class="collapsedComment collapsedCommentChild" id="collapsedComment64298" onclick="javascript:uncollapseComment(64298);">Comment hidden because of low score. Click to expand.</div>
<div class="uncollapsedComment" id="uncollapsedComment64298">
<a name="comment64298"></a>

<div class="childComment">

	<div class="votesWrapper" id="votes64298">

	</div>
	<div class="commentMain">
		<div class="commentBody">

				<div class="votesWrapperSubComment votesWrapperQuestion" id="votes64298">
					<div class="arrowUpQuestion authorHide56435" onclick="javascript:vote(1, 64298, 'comment')" id="arrowUp64298"></div>
					<div class="arrowUpQuestionDisabled authorShow56435" style="display: none;"></div>
					<div class="votesNetQuestion" id="votesNet64298">0</div>
					<div class="arrowDownQuestion authorHide56435" onclick="javascript:vote(-1, 64298, 'comment')" id="arrowDown64298"></div>
					<div class="arrowDownQuestionDisabled authorShow56435" style="display: none;"></div>
					<div class="votesCountQuestion" id="votesCount64298">of <span id="votesCountActual64298">0</span> votes</div>
					<div class="clearance"></div>
				</div>

			<p>This question was on a phone interview.</p>
		<span class="author">

			-
					<a href="/user?id=56435" onmouseover="popup(56435);">gauravk.18</a>
				 <abbr class="timeago" title="2008-11-02T04:16:30.014454Z">November 02, 2008</abbr> <span><edit author_id="56435" href="/editcomment?id=64298"></edit> | <a href="/flagcomment?id=64298">Flag</a>


		</span>
		</span></div>
	</div>
	<div class="clearance"></div>
</div>


			<div id="insertReplyHere3411" style="margin-left: 70px; display: none;"></div>

<div class="clearance"></div>
</div>

	</div><div id="commentThread56997">
    <div class="collapsedComment " id="collapsedComment56997" onclick="javascript:uncollapseComment(56997);">Comment hidden because of low score. Click to expand.</div>
<div class="uncollapsedComment" id="uncollapsedComment56997">
<a name="comment56997"></a>

<div class="comment">

	<div class="votesWrapper" id="votes56997">

		<div class="arrowUp authorHideNone" onclick="javascript:vote(1, 56997, 'comment')" id="arrowUp56997"></div>
		<div class="arrowUpDisabled authorShowNone" style="display: none;"></div>
		<div class="votesNet" id="votesNet56997">0</div>
		<div class="arrowDown  authorHideNone" onclick="javascript:vote(-1, 56997, 'comment')" id="arrowDown56997"></div>
		<div class="arrowDownDisabled authorShowNone" style="display: none;" id="arrowDown56997"></div>
		<div class="votesCount" id="votesCount56997">of <span id="votesCountActual56997">0</span> vote</div>
		<div class="clearance"></div>

	</div>
	<div class="commentMain">
		<div class="commentBody">

			<p>borrow some idea from gauravk.18.
<br>
<br>Create hash map for every person with person as the key, and the list of all his friend as the value. Then, ecah pair of people in the list is a two degree friends.</p>
		<span class="author">

			-
					lensbo
				 <abbr class="timeago" title="2008-07-18T20:26:48.911649Z">July 18, 2008</abbr> <span><edit author_id="None" href="/editcomment?id=56997"></edit> | <a href="/flagcomment?id=56997">Flag</a>


			<a onclick="javascript:insertReply('question', 56997, 2780);" class="replyButton" id="replyButton56997">Reply</a>
			<div class="clearance"></div>

		</span>
		</span></div>
	</div>
	<div class="clearance"></div>
</div>


			<div id="insertReplyHere56997" style="margin-left: 70px; display: none;"></div>

<div class="clearance"></div>
</div>

	</div><div id="commentThread56998">
    <div class="collapsedComment " id="collapsedComment56998" onclick="javascript:uncollapseComment(56998);">Comment hidden because of low score. Click to expand.</div>
<div class="uncollapsedComment" id="uncollapsedComment56998">
<a name="comment56998"></a>

<div class="comment">

	<div class="votesWrapper" id="votes56998">

		<div class="arrowUp authorHideNone" onclick="javascript:vote(1, 56998, 'comment')" id="arrowUp56998"></div>
		<div class="arrowUpDisabled authorShowNone" style="display: none;"></div>
		<div class="votesNet" id="votesNet56998">0</div>
		<div class="arrowDown  authorHideNone" onclick="javascript:vote(-1, 56998, 'comment')" id="arrowDown56998"></div>
		<div class="arrowDownDisabled authorShowNone" style="display: none;" id="arrowDown56998"></div>
		<div class="votesCount" id="votesCount56998">of <span id="votesCountActual56998">0</span> vote</div>
		<div class="clearance"></div>

	</div>
	<div class="commentMain">
		<div class="commentBody">

			<p>create hash map for every person with the person as the key, and the list of his friends as the value. Then when we got two person A and C, just merge the friends list of A and friends list of C, and if there are duplicate one, then, A and C is two degree friend.</p>
		<span class="author">

			-
					lensbo
				 <abbr class="timeago" title="2008-07-18T20:35:37.832760Z">July 18, 2008</abbr> <span><edit author_id="None" href="/editcomment?id=56998"></edit> | <a href="/flagcomment?id=56998">Flag</a>


			<a onclick="javascript:insertReply('question', 56998, 2780);" class="replyButton" id="replyButton56998">Reply</a>
			<div class="clearance"></div>

		</span>
		</span></div>
	</div>
	<div class="clearance"></div>
</div>


			<div id="insertReplyHere56998" style="margin-left: 70px; display: none;"></div>

<div class="clearance"></div>
</div>

	</div><div id="commentThread62102">
    <div class="collapsedComment " id="collapsedComment62102" onclick="javascript:uncollapseComment(62102);">Comment hidden because of low score. Click to expand.</div>
<div class="uncollapsedComment" id="uncollapsedComment62102">
<a name="comment62102"></a>

<div class="comment">

	<div class="votesWrapper" id="votes62102">

		<div class="arrowUp authorHideNone" onclick="javascript:vote(1, 62102, 'comment')" id="arrowUp62102"></div>
		<div class="arrowUpDisabled authorShowNone" style="display: none;"></div>
		<div class="votesNet" id="votesNet62102">0</div>
		<div class="arrowDown  authorHideNone" onclick="javascript:vote(-1, 62102, 'comment')" id="arrowDown62102"></div>
		<div class="arrowDownDisabled authorShowNone" style="display: none;" id="arrowDown62102"></div>
		<div class="votesCount" id="votesCount62102">of <span id="votesCountActual62102">0</span> vote</div>
		<div class="clearance"></div>

	</div>
	<div class="commentMain">
		<div class="commentBody">

			<p>@usafzz
<br>
<br>if(a-&gt;(friends+i)-&gt;friend==C)
<br>//this will not work as u go thro all the freinds of (friends+i), as it maynot have only one freind
<br>
<br>so its a O(n^2)</p>
		<span class="author">

			-
					mail2vcp@gmail.com
				 <abbr class="timeago" title="2008-10-01T11:02:21.385461Z">October 01, 2008</abbr> <span><edit author_id="None" href="/editcomment?id=62102"></edit> | <a href="/flagcomment?id=62102">Flag</a>


			<a onclick="javascript:insertReply('question', 62102, 2780);" class="replyButton" id="replyButton62102">Reply</a>
			<div class="clearance"></div>

		</span>
		</span></div>
	</div>
	<div class="clearance"></div>
</div>


			<div id="insertReplyHere62102" style="margin-left: 70px; display: none;"></div>

<div class="clearance"></div>
</div>

	</div><div id="commentThread61898">
    <div class="collapsedComment " id="collapsedComment61898" onclick="javascript:uncollapseComment(61898);">Comment hidden because of low score. Click to expand.</div>
<div class="uncollapsedComment" id="uncollapsedComment61898">
<a name="comment61898"></a>

<div class="comment">

	<div class="votesWrapper" id="votes61898">

		<div class="arrowUp authorHideNone" onclick="javascript:vote(1, 61898, 'comment')" id="arrowUp61898"></div>
		<div class="arrowUpDisabled authorShowNone" style="display: none;"></div>
		<div class="votesNet" id="votesNet61898">0</div>
		<div class="arrowDown  authorHideNone" onclick="javascript:vote(-1, 61898, 'comment')" id="arrowDown61898"></div>
		<div class="arrowDownDisabled authorShowNone" style="display: none;" id="arrowDown61898"></div>
		<div class="votesCount" id="votesCount61898">of <span id="votesCountActual61898">0</span> vote</div>
		<div class="clearance"></div>

	</div>
	<div class="commentMain">
		<div class="commentBody">

			<p>with adjacency matrix O(n^2) space as preprocessing, we can check for 2 degree friend in O(n)</p>
		<span class="author">

			-
					mail2vcp@gmail.com
				 <abbr class="timeago" title="2008-10-01T11:04:02.345935Z">October 01, 2008</abbr> <span><edit author_id="None" href="/editcomment?id=61898"></edit> | <a href="/flagcomment?id=61898">Flag</a>


			<a onclick="javascript:insertReply('question', 61898, 2780);" class="replyButton" id="replyButton61898">Reply</a>
			<div class="clearance"></div>

		</span>
		</span></div>
	</div>
	<div class="clearance"></div>
</div>


			<div id="insertReplyHere61898" style="margin-left: 70px; display: none;"></div>

<div class="clearance"></div>
</div>

	</div><div id="commentThread135723">
    <div class="collapsedComment " id="collapsedComment135723" onclick="javascript:uncollapseComment(135723);">Comment hidden because of low score. Click to expand.</div>
<div class="uncollapsedComment" id="uncollapsedComment135723">
<a name="comment135723"></a>

<div class="comment">

	<div class="votesWrapper" id="votes135723">

		<div class="arrowUp authorHideNone" onclick="javascript:vote(1, 135723, 'comment')" id="arrowUp135723"></div>
		<div class="arrowUpDisabled authorShowNone" style="display: none;"></div>
		<div class="votesNet" id="votesNet135723">0</div>
		<div class="arrowDown  authorHideNone" onclick="javascript:vote(-1, 135723, 'comment')" id="arrowDown135723"></div>
		<div class="arrowDownDisabled authorShowNone" style="display: none;" id="arrowDown135723"></div>
		<div class="votesCount" id="votesCount135723">of <span id="votesCountActual135723">0</span> vote</div>
		<div class="clearance"></div>

	</div>
	<div class="commentMain">
		<div class="commentBody">

			<p>This can be done in O(1) time after doing a preprocessing using O(n2) space and O(n3) time . suppose Adj is the adjacency matrix of the above graph . So Adj[i][j] is "1" if and only if node "i" and "j" are directly connected .
<br>
<br>Now , nodes "k" and "m"  are two degree friends if the following condition is true :
<br>
<br>if ((adj[k][0] &amp;&amp; adj[0][m] ) || (adj[k][1] &amp;&amp; adj[1][m] )  ..........|| (adj[k][MAXNODES -1 ] &amp;&amp; adj[MAXNODES - 1][m] ) is true .
<br>
<br>Consider another 2d array adj2[i][j] which stores the value of above condition for adj[i][j] . adj2 can be calculated as the 'boolean matrix product' of adj with itself . Here  'boolean matrix product'  means normal matrix multiplication with "multiplication" operation replaced with "&amp;&amp;" and "plus" operation replaced with "||" operation .
<br>
<br>Once adj2 is calculated we can say that "i" and "j" are 2 degree friends if and only if adj2[i][j] is 1.</p>
		<span class="author">

			-
					Shabnam
				 <abbr class="timeago" title="2009-06-01T05:35:24.695281Z">June 01, 2009</abbr> <span><edit author_id="None" href="/editcomment?id=135723"></edit> | <a href="/flagcomment?id=135723">Flag</a>


			<a onclick="javascript:insertReply('question', 135723, 2780);" class="replyButton" id="replyButton135723">Reply</a>
			<div class="clearance"></div>

		</span>
		</span></div>
	</div>
	<div class="clearance"></div>
</div>


			<div id="insertReplyHere135723" style="margin-left: 70px; display: none;"></div>

<div class="clearance"></div>
</div>

</div>
</div>
<br><br>
<script>
    function validate() { return false; }
</script>
<div id="insertReplyHere2780">
	<form method="post" onsubmit="javascript:return validate()">
    <div class="box" id="addCommentMain">
        <div class="boxHeader">
            <a id="textcommentlink" style="cursor:pointer; display: none; border-bottom: 1px dotted;">Add a Comment</a> <span id="textcommentnolink">Add a Comment</span>
        </div>
        <div class="boxBody">
			<div class="boxItem">
            <div class="boxItemTitle">Name:</div>
			<div class="boxItemValue">

                <input name="AuthorName" type="text" value="" style="width: 400px;" id="authorName2780">

            </div>
			</div>

			<div class="boxItem">
			<br>
<span class="warning">Writing Code? Surround your code with {{{ and }}} to preserve whitespace.</span>
			<br><br>
			<div>
            <textarea type="text" name="Comment" style="width: 95%; height: 100px;" class="commentRegex" onkeydown="return catchTab(this,event)" id="commentBox2780"></textarea>

			<input class="special" name="username" type="text">

            <input type="button" id="submitButton2780" value="Submit" class="addCommentSubmit" style="float: left;" onclick="javascript:postComment('question', 2780, 2780)"> <span id="submitting2780" style="display: none;">Submitting...</span>
			<div class="clearance"></div>
			</div>
			</div>
        </div>
    </div>
	</form>
</div>
<script>

var is_subscribed = false;

function refreshSubscribedUI() {
	if (is_subscribed) {
		$('.is_unsubscribed_items').hide();
		$('.is_subscribed_items').show();
	} else {
		$('.is_unsubscribed_items').show();
		$('.is_subscribed_items').hide();
	}
}

refreshSubscribedUI();

$(".subscribe_button").click(function() {
	if (is_subscribed) {
		var params = {'action': 'unsubscribe'};
		$('.is_subscribed_items').hide();
	} else {
		var params = {'action': 'subscribe'};
		$('.is_unsubscribed_items').hide();
	}
	$('.subscribe_loading_error').hide();
	$('.subscribe_loading_items').show();
	$('#ajax_vote_handler').load('/subscribe #subscribe', params,
    	function(response, status, xhr) {
    		$('.subscribe_loading_items').hide();
    		if (response == 'subscribed') {
    			is_subscribed = true;
    			refreshSubscribedUI();
    		} else if (response == 'unsubscribed') {
    			is_subscribed = false;
    			refreshSubscribedUI();
    		} else if (response == 'login') {
    			window.location = _url;
    		} else if (response == 'error') {
    			$('.subscribe_loading_error').show();
    		}
		}
	);
});

</script>


			</div>

			<div id="sidebar" class="column grid_3" data-swiftype-index="false">
				<div class="widget">

					<a id="add_question" href="/add">Add Question</a>

				</div>
				<div class="widget smalltext" id="userbox">
					<strong>CareerCup</strong> is the world's biggest and best source for software engineering interview preparation. <a href="/resources">See all our resources</a>.<br>
					<br>

					<div class="newLink"> <a href="/helpcareercup">How Can You Help CareerCup?</a></div>
					<br>

					<div class="newLink"> <a href="https://careercup.wufoo.com/forms/cracking-the-interview-talk-notifier/">Find Out When Gayle / CareerCup / Cracking the Coding Interview is in Your City</a></div>

				</div>


				<div id="attributes-menu"><div class="widget">
	<h4>Top Companies</h4>
	<ul id="top_companies">
		<ul id="top_companies">

			<li><a href="/page?pid=amazon-interview-questions">Amazon (4731)</a></li>

			<li><a href="/page?pid=microsoft-interview-questions">Microsoft (2085)</a></li>

			<li><a href="/page?pid=google-interview-questions">Google (1651)</a></li>

			<li><a href="/page?pid=bloomberg-lp-interview-questions">Bloomberg LP (690)</a></li>

			<li><a href="/page?pid=facebook-interview-questions">Facebook (678)</a></li>

			<li><a href="/page?pid=vestino-technologies-interview-questions">vestino technologies (599)</a></li>

			<li><a href="/page?pid=adobe-interview-questions">Adobe (473)</a></li>

			<li><a href="/page?pid=zynofus-technologies-private-limited-interview-questions">zynofus Technologies private limited (435)</a></li>

			<li><a href="/page?pid=yahoo-interview-questions">Yahoo (285)</a></li>

			<li><a href="/page?pid=goldman-sachs-interview-questions">Goldman Sachs (250)</a></li>

		<li><b><a href="/categories">More Companies »</a></b></li>
	</ul>
</ul></div>

<div class="widget">
	<h4>Top Jobs</h4>
	<ul id="top_companies">

		<li><a href="/page?pid=software-engineer-developer-interview-questions">Software Engineer / Developer (8000)</a></li>

		<li><a href="/page?pid=sde1-interview-questions">SDE1 (861)</a></li>

		<li><a href="/page?pid=software-engineer-in-test-interview-questions">Software Engineer in Test (823)</a></li>

		<li><a href="/page?pid=software-engineer-interview-questions">Software Engineer (773)</a></li>

		<li><a href="/page?pid=hr-executive-interview-questions">HR Executive (673)</a></li>

		<li><a href="/page?pid=sde-2-interview-questions">SDE-2 (651)</a></li>

		<li><a href="/page?pid=c-interview-questions">C (566)</a></li>

		<li><a href="/page?pid=software-developer-interview-questions">Software Developer (501)</a></li>

		<li><a href="/page?pid=developer-program-engineer-interview-questions">Developer Program Engineer (467)</a></li>

		<li><a href="/page?pid=java-developer-interview-questions">Java Developer (337)</a></li>

		<li><b><a href="/categories">More Jobs »</a></b></li>
	</ul>

</div>

<div class="widget">
	<h4>Top Topics</h4>
	<ul id="top_companies">

		<li><a href="/page?pid=algorithm-interview-questions">Algorithm (6087)</a></li>

		<li><a href="/page?pid=google-interview-questions">google (1134)</a></li>

		<li><a href="/page?pid=coding-interview-questions">Coding (987)</a></li>

		<li><a href="/page?pid=java-interview-questions">Java (911)</a></li>

		<li><a href="/page?pid=data-structures-interview-questions">Data Structures (859)</a></li>

		<li><a href="/page?pid=c-interview-questions">C (693)</a></li>

		<li><a href="/page?pid=c-plus-plus-interview-questions">C++ (625)</a></li>

		<li><a href="/page?pid=arrays-interview-questions">Arrays (468)</a></li>

		<li><a href="/page?pid=object-oriented-design-interview-questions">Object Oriented Design (355)</a></li>

		<li><a href="/page?pid=brain-teasers-interview-questions">Brain Teasers (329)</a></li>

		<li><b><a href="/categories">More Topics »</a></b></li>
	</ul>
</div></div>

				<div class="widget">
					<a href="https://careercup.wufoo.com/forms/careercup-bug-report/">Report a Bug or Issue</a>
				</div>


				<div class="widget" id="disableChatText"></div>
			</div>

			</div>
		</div>
		<div id="services" class="row" data-swiftype-index="false">
			<div class="column grid_12"></div>
			<div class="column grid_8">
				<div class="row">
					<div class="service column grid_4"><h3>Books</h3><p><script>writeBookLink("tgr", "Cracking the Tech Career")</script><a href="http://www.amazon.com/gp/product/1118968085/ref=as_li_ss_tl?ie=UTF8&amp;tag=care01-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=1118968085" undefined="">Cracking the Tech Career</a> is a comprehensive book on getting a job at a top tech company, while <script>writeBookLink("ctci", "Cracking the Coding Interview")</script><a href="http://www.amazon.com/gp/product/0984782850/ref=as_li_ss_tl?ie=UTF8&amp;tag=care01-20&amp;linkCode=as2&amp;camp=217145&amp;creative098478285050tiveASIN=0984782850" undefined="">Cracking the Coding Interview</a> focuses on dev interviews and <script>writeBookLink("ctpmi", "Cracking the PM Interview")</script><a href="http://www.amazon.com/gp/product/0984782818/ref=as_li_ss_tl?ie=UTF8&amp;tag=care01-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=1118968085" undefined="">Cracking the PM Interview</a> does this for PMs.</p><p><a href="/book">Learn More</a></p></div>
					<div class="service column grid_4"><h3>Videos</h3><p>CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.</p><p><a href="/video">Learn More</a></p></div>
				</div>
				<div class="row">
					<div class="service column grid_4"><h3>Resume Review</h3><p> Most engineers make critical mistakes on their resumes -- we can
						fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.</p> <p><a href="/resumereview">Learn More</a></p></div>
					<div class="service column grid_4"><h3>Mock Interviews</h3><p>Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.</p><p><a href="/interview">Learn More</a></p></div>
				</div>
			</div>
			<div id="bookstars" class="column grid_4"><script>writeBookLink("ctci", "<img src='/images/bookstars.jpg'>", "")</script><a href="http://www.amazon.com/gp/product/0984782850/ref=as_li_ss_tl?ie=UTF8&amp;tag=care01-20&amp;linkCode=as2&amp;camp=217145&amp;creative098478285050tiveASIN=0984782850"><img src="/images/bookstars.jpg"></a></div>
		</div>

	<!-- end main -->

	<footer id="page_footer" data-swiftype-index="false">
		<div class="row">
			<div class="column grid_3">
				<h4>Information</h4>
				<ul>
					<li><a href="/about">Team, Contact &amp; About</a></li>
					<li><a href="http://www.crackingthecodinginterview.com/resources.html">Additional Resources</a></li>
				</ul>
			</div>
			<div class="column grid_3">
				<h4>Products</h4>
				<ul>
					<li><script>writeBookLink("ctci", "Cracking the Coding Interview")</script><a href="http://www.amazon.com/gp/product/0984782850/ref=as_li_ss_tl?ie=UTF8&amp;tag=care01-20&amp;linkCode=as2&amp;camp=217145&amp;creative098478285050tiveASIN=0984782850" undefined="">Cracking the Coding Interview</a></li>
					<li><script>writeBookLink("ctpmi", "Cracking the PM Interview")</script><a href="http://www.amazon.com/gp/product/0984782818/ref=as_li_ss_tl?ie=UTF8&amp;tag=care01-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=1118968085" undefined="">Cracking the PM Interview</a></li>
					<li><script>writeBookLink("ctpmc", "Cracking the PM Career")</script><a href="https://amzn.to/3B9a7eU" undefined="">Cracking the PM Career</a></li>
					<li><script>writeBookLink("tgr", "Cracking the Tech Career")</script><a href="http://www.amazon.com/gp/product/1118968085/ref=as_li_ss_tl?ie=UTF8&amp;tag=care01-20&amp;linkCode=as2&amp;camp=217145&amp;creative=399373&amp;creativeASIN=1118968085" undefined="">Cracking the Tech Career</a></li>
					<li><a href="/video">Videos</a></li>
				</ul>
			</div>
			<div class="column grid_3">
				<h4>Services</h4>
				<ul>
					<li><a href="/interview">Mock Interviews</a></li>
					<li><a href="/resumereview">Resume Review</a></li>
					<li><a href="http://www.gayle.com/consulting/">Acquisition Interview Consulting</a></li>
				</ul>
			</div>
			<div class="column grid_3">
				<h4>Social</h4>
				<ul>
					<li><a href="http://www.facebook.com/careercup">CareerCup on Facebook</a></li>
					<li><a href="http://www.facebook.com/ctcibook">CtCI on Facebook</a></li>
					<li><a href="http://www.facebook.com/gayle">Gayle McDowell on Facebook</a></li>
					<li><a href="http://www.twitter.com/careercup">CareerCup on Twitter</a></li>
					<li><a href="http://www.twitter.com/gayle">Gayle on Twitter</a></li>
					<li><a href="http://blog.careercup.com">CareerCup Blog</a></li>
				</ul>
			</div>
			<div id="copyright" class="column grid_12">CareerCup.com © 2022</div>

		</div>
	</footer>
	<div id="ajax_vote_handler"></div>

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-315767-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>




		<script src="/js/prism.js"></script>
<script type="text/javascript">
var envoSn=79657;
var envProtoType = (("https:" == document.location.protocol) ? "https://" : "http://");
putChat();
</script>


	<!--[if lt IE 7 ]>
	<script src="js/libs/dd_belatedpng.js"></script>
	<script> DD_belatedPNG.fix('img, .png_bg');</script>
	<![endif]-->
<script type="text/javascript">
	var page_nav=new page_nav.dd("page_nav");
	page_nav.init("page_nav","page_navhover");
</script>
<script>
function refreshUserAdminInfo() {


}

$(document).ready(function() {
	refreshUserAdminInfo();

});

$(document).ready(function() {
	$("#attributes-menu").load("/controlattributesmenu");
});

jQuery(document).ready(function() {
  jQuery("abbr.timeago").timeago();
});
</script>




<div id="st-main-container" style="display: none;">   <div class="swiftype">   <a class="close" data-dismiss="st-modal" href="#">×</a>   <div class="st-search-bar st-only-input">     <form>       <div class="st-input-wrapper">         <div class="st-input-inner">           <input type="text" value="" id="st-overlay-search-input" placeholder="Search this website" aria-label="Search this website" autocomplete="off" autocorrect="off" autocapitalize="off" style="outline: none;">           <span class="st-input-icon"></span>           <a href="https://swiftype.com?ref=pbo" class="st-input-powered-by st-powered-by" target="_blank"></a>         </div>         <input type="submit" value="search" id="submitbutton">       </div>     </form>   </div>   <div class="st-result-wrapper" style="min-height: 460px;">     <div class="st-result-listing">       <div class="st-results">       </div>       <div class="st-indexing-notice" style="display: none;">         This site is still being indexed. Please try your search again in a few minutes.       </div>       <div class="st-logo-footer st-powered-by">         <a href="http://swiftype.com?ref=pbo" target="_blank">search by swiftype</a>       </div>     </div>   </div> </div> </div><div class="swiftype-widget"><div class="autocomplete" style="position: absolute; z-index: 199999; width: 210px; top: 0px; left: -8px; display: none;"><ul></ul></div></div><div class="swiftype-widget"><div class="autocomplete" style="position: absolute; z-index: 199999; width: 234px; top: 105px; left: 1505.5px; display: none;"><ul></ul></div></div></body></html>